package com.his.registration.service.impl;

import com.his.dto.DrugCharge;
import com.his.registration.mapper.PrescriptionMapper;
import com.his.registration.service.PrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @BelongsProject: workspace-idea
 * @BelongsPackage: com.his.registration.service.impl
 * @Author: ZhangYing
 * @Date: 2023/7/2 15:51
 * @Description:
 */
@Service
public class PrescriptionServiceImpl implements PrescriptionService {
    @Autowired
    private PrescriptionMapper prescriptionMapper;

    @Override
    public List<DrugCharge> getDrugFee(int registerId) {
        return prescriptionMapper.getDrugFee(registerId);
    }

    @Override
    public int charge(String drugState,int id) {
        return prescriptionMapper.charge(drugState,id);
    }

    @Override
    public int insert(int registerId, int drugId, LocalDateTime creationTime, String drugState) {
        return prescriptionMapper.insert(registerId,drugId,creationTime,drugState);
    }

    @Override
    public int update(String drugUsage, int drugNumber, int id) {
        return prescriptionMapper.update(drugUsage,drugNumber,id);
    }

    @Override
    public int getInsertId() {
        return prescriptionMapper.getInsertId();
    }

    @Override
    public int deleteById(int id) {
        return prescriptionMapper.deleteById(id);
    }
}
